
// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

import NECommonKit
import NIMSDK
import UIKit

@objcMembers
open class TeamIntroduceViewController: NEBaseTeamIntroduceViewController {
    override open func setupUI() {
        super.setupUI()
        view.backgroundColor = .normalTeamBackColor
        navigationView.backgroundColor = .normalTeamBackColor
        navigationController?.navigationBar.backgroundColor = .normalTeamBackColor
        addRightAction(localizable("save"), #selector(saveIntr), self)
        navigationView.setBackButtonTitle(localizable("cancel"))
        navigationView.backButton.setTitleColor(.normalTeamTitleColor, for: .normal)
        navigationView.backButton.titleLabel?.font = NEConstant.defaultTextFont(14)
        navigationView.moreButton.setTitleColor(.normalTeamOrangeColor, for: .normal);
        navigationView.moreButton.titleLabel?.font = NEConstant.defaultTextFont(14)

        backView.layer.cornerRadius = 0.0
        NSLayoutConstraint.activate([
            backView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0),
            backView.topAnchor.constraint(equalTo: view.topAnchor, constant: NEConstant.navigationAndStatusHeight),
            backView.rightAnchor.constraint(equalTo: view.rightAnchor, constant:0),
            backView.heightAnchor.constraint(equalToConstant: 170),
        ])
        
        NSLayoutConstraint.activate([
            textView.leftAnchor.constraint(equalTo: backView.leftAnchor, constant: 12.0),
            textView.rightAnchor.constraint(equalTo: backView.rightAnchor, constant: -32.0),
            textView.topAnchor.constraint(equalTo: backView.topAnchor, constant: 12.0),
            textView.heightAnchor.constraint(equalToConstant: 120),
        ])
        
        NSLayoutConstraint.activate([
            clearButton.rightAnchor.constraint(equalTo: backView.rightAnchor, constant: -12),
            clearButton.bottomAnchor.constraint(equalTo: countLabel.topAnchor, constant: -6),
            clearButton.widthAnchor.constraint(equalToConstant: 16),
            clearButton.heightAnchor.constraint(equalToConstant: 16),
        ])
    }
}
